﻿using Autodesk.Windows;
using Autodesk.AutoCAD.Ribbon;
using Autodesk.AutoCAD.Runtime;
using System.Windows.Controls;
using System.Windows.Media;


namespace Galaxy.AutoCAD.Ribbons
{
    public class RibbonTool
    {
        [CommandMethod("AddGalaxyRibbon")]
        public void AddGalaxyRibbon()
        {
            RibbonControl rc = RibbonServices.RibbonPaletteSet.RibbonControl;
            RibbonTab galRibTab = RibbonTabTool.CreateRibbonTab("银河插件", "银河插件");
            rc.Tabs.Add(galRibTab);
            //一般模块Panel定义
            RibbonPanelSource genRibPanSou = new RibbonPanelSource();
            genRibPanSou.Title = "一般模块";
            RibbonPanel genRibPan = new RibbonPanel();
            genRibPan.Source = genRibPanSou;
            galRibTab.Panels.Add(genRibPan);
            RibbonButton cDPRibBut = RibbonButtonTool.CreateRibbonButton("计算非连续多段线长度", "计算非连续多段线长度", true, true, RibbonItemSize.Large, Orientation.Vertical, "CDP ");
            genRibPanSou.Items.Add(cDPRibBut);
            RibbonButton dCLRibBut = RibbonButtonTool.CreateRibbonButton("绘制云线", "绘制云线", true, true, RibbonItemSize.Large, Orientation.Vertical, "DCL ");
            genRibPanSou.Items.Add(dCLRibBut);
            //叠合板模块Panel定义
            RibbonPanelSource lamRibPanSou = new RibbonPanelSource();
            lamRibPanSou.Title = "叠合板模块";
            RibbonPanel lamRibPan = new RibbonPanel();
            lamRibPan.Source = lamRibPanSou;
            galRibTab.Panels.Add(lamRibPan);
            RibbonButton preRibBut = RibbonButtonTool.CreateRibbonButton("前置条件", "前置条件   ", true, true, RibbonItemSize.Large, Orientation.Vertical, "CLHDB CLGLDB CLNL ");
            lamRibPanSou.Items.Add(preRibBut);
            RibbonButton creLamRibBut = RibbonButtonTool.CreateRibbonButton("叠合板方向", "叠合板方向   ", true, true, RibbonItemSize.Large, Orientation.Vertical, "CLD ");
            lamRibPanSou.Items.Add(creLamRibBut);
            RibbonButton rotLamDerRibBut = RibbonButtonTool.CreateRibbonButton("旋转叠合板方向", "旋转叠合板方向   ", true, true, RibbonItemSize.Large, Orientation.Vertical, "RLD ");
            lamRibPanSou.Items.Add(rotLamDerRibBut);


            galRibTab.IsActive = true;
        }
    }
}
